# for shared lib (dynamic lib)
libmy_std.so:mstdio.o mstring.o
	gcc -o $@ $^ -shared
%.o:%.c
	gcc -fPIC -c $<

.PHONY:clean
clean:
	rm -rf *.so *.o stdc*
.PHONY:output
output:
	mkdir -p stdc/include
	mkdir -p stdc/lib
	cp -f *.so stdc/lib
	cp -f *.h stdc/include
	tar -czf stdc.tgz stdc













## for static lib
#libmy_std.a : mstdio.o mstring.o
#	@ar -rc $@ $^
#	@echo "Forming static lib($^ to $@)... done!"
#
#%.o : %.c
#	@gcc -c $<
#	@echo "compiling $< to $@... done!!"
#	
#.PHONY : clean
#clean :
#	@rm -rf *.a *.o stdc*
#	@echo "rm done!!!"
#	
#.PHONY : output
#output :
#	@mkdir -p stdc/include
#	@mkdir -p stdc/lib
#	@cp -f *.h stdc/include
#	@cp -f *.a stdc/lib
#	@tar -czf stdc.tgz stdc
#	@echo "output done!!!!"
#
